package com.pucong.gitee.database.backup.common.selfenum;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel("数据库类型枚举类")
public enum DatabaseTypeEnum implements CommonEnum<Integer> {

    oracle(0, "oracle"),
    sqlserver(1, "sqlserver"),
    mysql(2, "mysql"),
    hive(3, "hive"),
    postgresql(4, "postgresql"),
    redis(5, "redis"),
    mongodb(6, "mongodb"),
    db2(7, "db2"),
    oscar(8, "oscar"),
    h2db(9, "h2db");

    @ApiModelProperty(value = "key",example = "1")
    private Integer key;

    @ApiModelProperty("描述")
    private String desc;

    DatabaseTypeEnum(Integer key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    /**
     * 字典code
     *
     * @return
     */
    @Override
    public Integer getValue() {
        return this.key;
    }

    /**
     * 字典名称
     *
     * @return
     */
    @Override
    public String getName() {
        return this.name();
    }
}